package com.ihr360.excel.service;

import com.ihr360.excel.annotation.InterruptIgnore;
import com.ihr360.excel.service.fallback.IrenshiFileDubboServiceFallback;
import com.ihr360.excel.vo.ProgressContext;
import com.ihr360.excel.vo.ProgressContextFile;
import com.ihr360.excel.vo.StaffUniqueVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "irenshi-dubbo-provider", fallback = IrenshiFileDubboServiceFallback.class)
public interface IrenshiFileDubboService {


    /**
     * @param fileId
     * @return
     */
    @RequestMapping(value = "/file/excel", method = RequestMethod.GET)
    ProgressContextFile getFile(@RequestParam(value = "fileId") String fileId, @RequestParam(value = "progressKey") String progressKey);


    /**
     * 根据姓名和手机号获取员工id
     */
    @RequestMapping(value = "/staffInfo/uniqueInfos", method = RequestMethod.POST)
    List<StaffUniqueVo> getStaffInfo(@RequestBody List<StaffUniqueVo> staffUniqueVos, @RequestParam(value = "progressKey") String progressKey);


    /**
     * 保存文件到Excel服务
     *
     * @param progressContext
     * @return
     */
    @RequestMapping(value = "/file/excel/save", method = RequestMethod.POST)
    String saveExcel(@RequestBody ProgressContext progressContext);


}
